<template>
  <div class="common-layout">
    <el-container>
      <el-aside width="200px">
        <el-row class="tac">
          <el-col :span="24">
            <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              @open="handleOpen"
              @close="handleClose"
              unique-opened="true"
              :router="true"
            >
              <img src="@/assets/logoq.png" alt="" />
              <el-menu-item index="/">
                <el-icon ><Odometer /></el-icon>
                <span>仪表盘</span>
              </el-menu-item>
              <el-sub-menu index="2">
                <template #title>
                  <el-icon><icon-menu /></el-icon>
                  <span>常用设置</span>
                </template>
                <el-menu-item-group title="">
                  <el-menu-item index="/jsgl">教师管理</el-menu-item>
                  <el-menu-item index="/xsgl">学生管理</el-menu-item>
                  <el-menu-item index="/gggl">公告管理</el-menu-item>
                  <el-menu-item index="/xtpz">系统配置</el-menu-item>
                  <el-menu-item index="/ptfwq">判题服务器</el-menu-item>
                </el-menu-item-group>
              </el-sub-menu>
              <el-sub-menu index="3">
                <template #title>
                  <el-icon><Aim  /></el-icon>
                  <span>问题</span>
                </template>
                <el-menu-item-group title="">
                  <el-menu-item index="/wtlb">问题列表</el-menu-item>
                  <el-menu-item index="/zjtm">增加题目</el-menu-item>
                  <el-menu-item index="/drdctm">导入导出题目</el-menu-item>
                </el-menu-item-group>
              </el-sub-menu>
              <el-sub-menu index="4">
                <template #title>
                  <el-icon><Trophy  /></el-icon>
                  <span>比赛&练习</span>
                </template>
                <el-menu-item-group title="">
                  <el-menu-item index="/bslb">比赛列表</el-menu-item>
                  <el-menu-item index="/cjbs">创建比赛</el-menu-item>
                </el-menu-item-group>
              </el-sub-menu>
              <el-sub-menu index="5">
                <template #title>
                  <el-icon><Management /></el-icon>
                  <span>课程</span>
                </template>
                <el-menu-item-group title="">
                  <el-menu-item index="/kclb">课程列表</el-menu-item>
                  <el-menu-item index="/cjkc">创建课程</el-menu-item>
                </el-menu-item-group>
              </el-sub-menu>
            </el-menu>
          </el-col>
        </el-row>
      </el-aside>
      <el-container>
        <el-header class="hf">
          
          <span class="xl">
            <el-menu
          :default-active="activeIndex"
          class="el-menu-demo"
          mode="horizontal"
          @select="handleSelect"
          >
          <el-sub-menu index="1">
            <template #title>
              <el-icon><Search /></el-icon>
              <el-icon><Share  /></el-icon>
              username
              </template>
            <el-menu-item index="1-1">logout</el-menu-item>
          </el-sub-menu>
          </el-menu>
          </span>
          
        </el-header>
        <el-main>
          <router-link to="/"></router-link>
          <router-view></router-view>
          
        </el-main>
        <el-footer class="hf">
          <p>Build Version:20210929bd</p>
        </el-footer>
      </el-container>
    </el-container>
  </div>

</template>

<script setup>
import {
  Aim,
  Menu as IconMenu,
  Odometer,
  Trophy,
  Management,
  Search,
  Share,
  InfoFilled
} from "@element-plus/icons-vue";
import { ElMessage } from "element-plus";
// import FirstHello from './FirstHello.vue'

const handleOpen = (key, keyPath) => {
  console.log(key, keyPath);
};
const handleClose = (key, keyPath) => {
  console.log(key, keyPath);
};
const open = () => {
  // ElMessage({
  //   message: "版权所有，补课侵权，联系方式xxxx",
  //   type: "info",
  // });
};

// export default{
//   components:{
//     FirstHello
//   }
// }
</script>

<script>
// import {Edit,Check,} from '@element-plus/icons-vue'
export default {
  data() {
    return {
      // message: '这是Hello组件',
     
    };
  },
  methods: {
   
  },
  // components:{
  //     Edit,
  //     Check,
  // }
};
import { ref } from 'vue'

const activeIndex = ref('1')
const activeIndex2 = ref('1')
const handleSelect = (key, keyPath) => {
  console.log(key, keyPath)
}
</script>

<style >
* {
  padding: 0;
  margin: 0;
}
.el-header{
  background-color: #F9FAFC;
  color: #000;
}


.el-footer {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  /* line-height: 200px; */
}
.el-main {
  background-color: #e9eef3;
  color: #333;
  line-height: 20px;
  height: 500px;
}
.zj{
  background-color: white;
  border:none;
  border-radius: 4px;
}
.bt{
  padding: 10px 10px;
  text-align: left;
  border-bottom: 1px solid rgb(230, 227, 227);
}
.zt{
  
  height: 200px;
  margin-top: 25px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}

img {
  width: 100%;
}



</style>
